const { Article } = require('../../model/article');
module.exports = async (req,res)=>{
  let article = await Article.findOne({_id: req.query.id});
  if(article){
    await Article.findByIdAndDelete(req.query.id);
    res.redirect('/admin/toArticleListPage');
  }else{
    res.render('admin/articleList',{
      message: '删除失败！！！'
    });
  }
}